﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net.Sockets;
using System.Threading;

namespace Uniriotec.DC.CoordDist.Distribuida
{
    public partial class Form1 : Form
    {

        public Form1()
        {
            InitializeComponent();
        }

        void Start(int port, int num)
        {
            for (int i = 1; i < num + 1; i++)
            {
                StartProcessParameters parameters = new StartProcessParameters(num, i, port);
                Process proc = new Process();
                Thread a = new Thread(new ParameterizedThreadStart(proc.Start));
                a.Start(parameters);
                port++;
            }
        }

        private void startButton_Click(object sender, EventArgs e)
        {
            Start(5200, (int)portNumber.Value);
        }

    }
}